<template>
  <div class="app-container org">
    <!-- 左侧区域 -->
    <el-card class="leftCard">
      <el-tabs v-model="activityName" class="demo-tabs">
        <el-tab-pane label="未完成" name="first">
          <isComplete v-if="activityName == 'first'" @getSeqId="getSeqId" :userStatus="0" :userStepId="0"/>
        </el-tab-pane>
        <el-tab-pane label="已完成" name="second">
          <isComplete v-if="activityName == 'second'" @getSeqId="getSeqId" :userStatus="1" :userStepId="0"/>
        </el-tab-pane>
      </el-tabs>
    </el-card>

    <!-- 右侧区域 -->
    <el-card class="rightCard">
      <sampleWithView :projectId="form.projectId" ref="sampleWithViewRef"/>
    </el-card>
  </div>
</template>

<script setup name="SampleWith">
import isComplete from "./components/isComplete";
import sampleWithView from "./components/sampleWithView";

const activityName = ref("first");
const form = ref({});
const sampleWithViewRef = ref(null);

function getSeqId(val) {
  form.value.projectId = val;
  nextTick(() => {
    sampleWithViewRef.value.queryParams.userStepId = 0
    if (activityName.value == "first") {
      sampleWithViewRef.value.queryParams.userStatus = 0
    }else{
      sampleWithViewRef.value.queryParams.userStatus = 1
    }
    sampleWithViewRef.value.getList();
  });
}
</script>

<style></style>
